<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>上传文件测试</title>
<%@ include file="/common/simpleupload.jsp"%>
<script type="text/javascript" src="${res}/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript"
	src="${res}/js/upload/handler/file-upload-handler.js"></script>
<script type="text/javascript">
var resPath="${res}";
var ctxPath="${ctx}";
var jsessionId = "<%=session.getId() %>";
var swfu;
window.onload = function() {
	swfu = new SWFUpload(
			{
				flash_url : resPath+"/js/upload/swfupload.swf",
				upload_url: ctxPath+"/upload/upload",
				post_params : {
					jsessionId:jsessionId
				},
				file_post_name:"fileData",
				file_size_limit : "10 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 100,
				file_queue_limit : 1,
				button_action : SWFUpload.BUTTON_ACTION.SELECT_FILE,
				custom_settings : {
					upload_target : "fsStationfileUploadProgress"
				},
				debug: false,

				// The event handler functions are defined in handlers.js
		        file_dialog_start_handler: filesFileDialogStart,
			    swfupload_loaded_handler : filesUploadLoaded,
			    file_queued_handler : filesFileQueued,
			    file_queue_error_handler : filesFileQueueError,
			    file_dialog_complete_handler : filesFileDialogComplete,
			    upload_start_handler : filesUploadStart,
			    upload_progress_handler : filesUploadProgress,
			    upload_error_handler : filesUploadError,
			    upload_success_handler : filesUploadSuccess,
			    upload_complete_handler : filesUploadComplete,
			    queue_complete_handler : filesQueueComplete,	// Queue plugin event
			    swfupload_load_failed_handler : filesSwfUploadLoadFailed,
			    swfupload_pre_load_handler : filesSwfUploadPreLoad,
				

				// Button Settings
				button_image_url :resPath+"/image/btn_chosefile.gif",
			    button_width: "66",
			    button_height: "22",
				button_placeholder_id : "spanButtonPlaceholder",

				custom_settings : {
					progressTarget : "fsStationfileUploadProgress"
				},
				// Debug Settings
				debug : false
			// 是否显示调试窗口
			});
};

function startUploadFile() {
	$('#btnUpload_cancel').attr("disabled",true);
	swfu.startUpload();

}
</script>
</head>
<body>
<div id="swfBlock">
<table style="margin-left: 10px; font-size: 12px;">
	<tr>
		<td valign="top">选择文件:</td>
		<td><input disabled="disabled" name="avatarsFileName"
			id="avatarsFileName" type="text" class="input_text"
			style="width: 270px" value="" /> <span id="spanButtonPlaceholder"></span>
		<div id="fsStationfileUploadProgress"></div>
		<div id="divFileLoadingContent" class="fill_tips"
			style="display: none;">1号提示信息</div>
		<div id="divFileLongLoading" class="fill_tips" style="display: none;">2号提示信息</div>
		<div id="divFileAlternateContent" class="fill_tips"
			style="display: none;">3号提示信息</div>
		</td>
	</tr>
	<tr class="button_bar_uploadx">
		<td colspan="2"><input id="btnUpload" type="button" value="上传"
			onclick="startUploadFile();" class="button" disabled="disabled" />&nbsp;&nbsp;
		<input id="btnUpload_cancel" type="button" value="取消" onclick=""
			class="button" /></td>
	</tr>
</table>
</div>
</body>
</html>